package com.apes.tutoring;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @author ZhangyiA
 * @describe:
 * @date 2021/07/09
 */

public class Three_TimeManagement {

    public static void main(String[] args){
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        Map<Integer , Integer> manager = new HashMap<>();
        for(int i = 0 ; i < n ; i ++){
            int s = input.nextInt();
            int e = input.nextInt();
            int sval = manager.containsKey(s) ? manager.get(s) : 0;
            int eval = manager.containsKey(e) ? manager.get(e) : 0;
            manager.put(s, sval + 1);
            manager.put(e, eval - 1);
        }
        int cur = 0 , ans = 0;
        for(Map.Entry<Integer , Integer> entry : manager.entrySet()){
            cur += entry.getValue();
            ans = Math.max(ans , cur);
        }
        System.out.println(ans);
    }

}
/*
4
1 4
1 2
2 3
3 4
* */